﻿//import mx.utils.Delegate;
class cn.eminia.RClassV3.Util {
	function Util() {
	}
	// 这个单独绑定，一般不用
	static function connectNode(who, arr:Array) {
		who.watch('per', function (vv, oldvv, newvv) {
			for (var i:Number = 0; i<arr.length; i++) {
				arr[i].updatePos(vv, oldvv, newvv);
			}
		});
		return;
	}
	// 一起绑定 
	public static function bind() {
		var a:Array = arguments;
		for (var i:Number = 0; i<a.length; i++) {
			//
			var who = a[i];
			var arr:Array = (a.slice(0, i).concat(a.slice(i+1, a.length)));
			cn.eminia.RClassV3.Util.connectNode(who, arr);
		}
		return;
	}
	public static function unbind() {
		var a:Array = arguments;
		for (var i:Number = 0; i<a.length; i++) { 
			var who = a[i];
			who.unwatch('per');
		}
		return;
	}
	public static function isFullHeight(	msk:MovieClip, 
											page_tf:TextField,
											page_placeHolder:MovieClip):Boolean {
		if(page_placeHolder!=null){
			page_placeHolder._y = page_tf._y + page_tf._height;
		}
		
		if (page_tf._y+page_tf._height > msk._height) { 
			return true ;
			} else {
			return false ;
			
		}
		
	}
}
